package cn.cvs.controller;

import cn.cvs.service.SysUserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/sys/user")
public class SysUserController {

    @Resource
    SysUserService sysUserService;

    @RequestMapping("/list")
    public Object getUserList(){
        return sysUserService.findAll();
    }

    @GetMapping("/view/{usrId}")
    public Object getUserById(@PathVariable("usrId") Integer usrId){
        System.out.println("usrId:"+ usrId);
        return sysUserService.findByUsrId(usrId.longValue());
    }
}
